<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="webwork" prefix="s"%>
<%@ taglib uri="/tld/common.tld" prefix="co"%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
.field-error,.field-error ul,.field-error li,.action-error,.action-error ul,.action-error li,.action-message,.action-message ul,.action-message li
	{
	display: inline;
	padding: 0;
}

.field-error li,.action-error li,.action-message li {
	list-style: none;
}

.field-error li,.action-error li {
	color: red;
}

.action-message li {
	color: green;
}

table {
	width: 100%;
}
</style>
</head>
<body>
	<s:actionerror />
	<s:actionmessage />
	<form action="list.do" method="post">
		<input type="hidden" name="_e" value="1" />
		<co:paramKeeper name="_m, _sn" />
		<s:set name="isSelectMode" value="#parameters._m[0] == \"1\"" />
		<table>
			<tbody>
				<s:iterator value="getClassMapping().properties" id="p">
					<s:if test="#p.query">
						<tr>
							<td><s:property value="#p.showName" /></td>
							<td><input type="text" name="<s:property value="#p.name" />"
								value="<s:property value="%{#parameters[#p.name]}" />" /></td>
						</tr>
					</s:if>
				</s:iterator>
			</tbody>
		</table>
		<table>
			<tbody>
				<tr>
					<td align="right"><s:if test="!#isSelectMode">
							<s:url id="u" action="input" />
							<s:a href="%{u}">
								<s:text name="text.add" />
							</s:a>
						</s:if> <input type="submit" value="<s:text name="text.query" />" /></td>
				</tr>
			</tbody>
		</table>
		<table>
			<thead>
				<tr>
					<s:if test="#isSelectMode">
						<td><s:text name="text.select" />
						</td>
					</s:if>
					<s:iterator value="getClassMapping().properties" id="p">
						<s:if test="#p.show">
							<td><s:property value="#p.showName" /></td>
						</s:if>
					</s:iterator>
					<td><s:text name="text.operation" />
					</td>
				</tr>
			</thead>
			<s:if test="list.size > 0">
				<tbody>
					<s:iterator value="list" id="vo">
						<tr>
							<s:if test="#isSelectMode">
								<td><input type="radio" name="_sv"
									value="<s:property value="#vo.id" />" />
								</td>
							</s:if>
							<s:iterator value="getClassMapping().properties" id="p">
								<s:if test="#p.show">
									<td><s:property value="%{#vo[#p.name]}" /></td>
								</s:if>
							</s:iterator>
							<td><s:if test="!#isSelectMode">
									<s:url id="u" action="input">
										<s:param name="id">
											<s:property value="#vo.id" />
										</s:param>
									</s:url>
									<s:a href="%{u}">
										<s:text name="text.modify" />
									</s:a>
								</s:if></td>
						</tr>
					</s:iterator>
				</tbody>
			</s:if>
		</table>
		<s:if test="#isSelectMode && list.size > 0">
			<input type="submit" value="<s:text name="text.select" />" />
		</s:if>
	</form>
</body>
</html>